package Day;

import java.util.HashSet;
import java.util.Scanner;

public class Day3 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        HashSet<Character>hash=new HashSet<>();
        for (int i = 0; i <s2.length() ; i++) {
            hash.add(s2.charAt(i));
        }
StringBuffer sb=new StringBuffer();
        for(int i=0;i<s1.length();i++){
            if(!hash.contains(s1.charAt(i)))
            sb.append(s1.charAt(i));
        }
        System.out.println(sb);

    }



}
